import type { PropType } from 'vue'

export const numericProp = [Number, String]

export const makeRequiredProp = <T>(type: T) => ({
  type,
  required: true as const,
})

export const makeNumericProp = <T>(defaultVal?: T) => ({
  type: numericProp,
  default: defaultVal,
})

export const makeNumberProp = <T>(defaultVal?: T) => ({
  type: Number,
  default: defaultVal,
})

export const makeStringProp = <T = string>(defaultVal?: T) => ({
  type: String as unknown as PropType<T>,
  default: defaultVal,
})
